<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .box {
        width: 300px;
        margin: auto;
    }

    .box-list {
        width: 300px;
        height: 200px;
        display: flex;
        overflow: hidden;
    }

    .left {
        position: absolute;
        top: 100px;
        background-color: #f40;
    }

    .right {
        position: absolute;
        top: 100px;
        margin-left: 300px;
        background-color: #f40;
    }
</style>

<body>
    <div class="box">
        <div class="box-list">
            <img src="../public/img/1.jpg" style="width: 300px; height: 200px;" />
            <img src="../public/img/2.jpg" style="width: 300px; height: 200px;" />
            <img src="../public/img/3.jpg" style="width: 300px; height: 200px;" />
        </div>
        <div>
            <div class="left">《</div>
            <div class="right">》</div>
        </div>
    </div>
</body>
<script>
    function moveTo(index) {
        const dom = document.querySelector('.box-list')
        dom.style.transform = `translateX(-${index * 100}%)`
        dom.style.transition = 'transform .5s'
    }
</script>

</html>